package com.naiterui.ehp.bs.wechat.param;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @Description: 微信公众号关注/扫码事件
 * 【官方文档】https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140454
 * @Author: zhoupeipei
 * @Date： 2019/1/18
 */
@JacksonXmlRootElement(localName = "xml")
public class EventSubscribe extends BaseMessage implements Serializable {

    private static final long serialVersionUID = -8713122065472108897L;
    /**
     * SUBSCRIBE、UNSUBSCRIBE、SCAN
     * {@link com.naiterui.ehp.bs.wechat.constants.WeChatConstant.EventType}
     */
    @JacksonXmlProperty(localName = "Event")
    private String event;
    /**
     * subscribe时：事件KEY值，qrscene_为前缀，后面为二维码的参数值
     * SCAN时：事件KEY值，是一个32位无符号整数，即创建二维码时的二维码scene_id
     */
    @JacksonXmlProperty(localName = "EventKey")
    private String eventKey;
    /**
     * 二维码的ticket，可用来换取二维码图片
     */
    @JacksonXmlProperty(localName = "Ticket")
    private String ticket;

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getEventKey() {
        return eventKey;
    }

    public void setEventKey(String eventKey) {
        this.eventKey = eventKey;
    }

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
